var mysql = require ('mysql');

var connection = mysql.createPool({
	host:'localhost',
	port:'3306',
	user:'root',
	password:'',
	database:'bus',
	connectionLimit:100,
	queueLimit:10,
	supportBigNumbers:true
});


function getConnection(callback){
	connection.getConnection(function (err,client){
		if(err){
			console.log(err);
			setTimeout(getConnection,2000);
		}
		callback(client);
	})
}

exports.getConnection=getConnection;